<% content_for :sitemap do %>
  <span class="current">回复</span>
<% end %>
<h1>Listing replies</h1>

<table class="grid">
  <tr class="head">
    <td class="first">ID</td>
    <td style="width:500px">Body</td>
        <td>Topic</td>
    <td>User</td>
    <td>At</td>

    <td></td>
  </tr>

<% @replies.each do |reply| %>
  <tr>
    <td class="first"><%= reply.id %></td>
    <td><%= truncate(reply.body, :length => 50) %></td>
    <% if reply.topic %>
      <td>
          <%= link_to(reply.topic_id, topic_path(reply.topic_id), :title => reply.topic.title)%>
          </td>
      <% else %>
      <td><%= reply.topic_id %></td>
      <% end %>
    <td><%= reply.user.login if reply.user %></td>
    <td><%= l reply.created_at, :format => :short %></td>
    <td><%= link_to t("common.edit"), edit_cpanel_reply_path(reply) %>
    <%= link_to t("common.delete"), cpanel_reply_path(reply), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>
<%= will_paginate @replies %>

